$(function(){
    $('form').validate({
        errorPlacement: function(error, element) { 
            error.appendTo(element.parents('form')); 
        },
        onfocusout:true,
        focusInvalid:false,
        focusCleanup:true,
        errorElement:"span",
    })
})